# -*- coding:utf-8 -*-

## =====================================================================
## Copyright (C) 2007-2011 Jean-Philippe GOLAY 
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
## =====================================================================

import sys, os, os.path
import logging, logging.handlers
from Tkinter import *
import Pmw
from tkMessageBox import *

import FullDB
from iPlace import PlaceGUI
from iPerson import PersonGUI
from iArea import AreaGUI
from iStaff import StaffGUI
from iTimeSheetStaff import TimeSheetStaffGUI
from iDiscount import DiscountGUI
from iFamily import ProductFamilyGUI, ServiceFamilyGUI, ItemFamilyGUI
from iService import ServiceGUI
from iParking import ParkingGUI
from iProduct import ProductGUI
from iItem import ItemGUI
from iStay import StayGUI
from iOcupancy import OcupancyGUI
from iCleaning import CleaningGUI
from iTechnical import TechnicalGUI
from iCatalogue import CatalogueGUI
from iBill import BillGUI
from iTax import TaxGUI
from iStock import StockGUI
from iInvantory import InvantoryGUI
from iReservation import ReservationGUI
from iOcupancySchedule import OcupancyScheduleGUI
from iCleaningSchedule import CleaningScheduleGUI
from iTechnicalSchedule import TechnicalScheduleGUI
from iVariable import Glob
from iBackup import BackupDB

class iManageGUI(Frame):
	def __init__(self, parent=None):
		Frame.__init__(self, parent)
		self.master.protocol("WM_DELETE_WINDOW", self.closeiManage)
		self.master.title(Glob.PRG_TITLE)
		self.master.iconname(Glob.PRG_ICON_NAME)
		# Répertoire de lancement de imanage
		self.imanage_path=str(os.getcwd())
		# Construction du logger d'événements
		logging.basicConfig()
		self.log = logging.getLogger("imanage")
		self.log.setLevel(logging.DEBUG)
		handler = logging.FileHandler(self.imanage_path+"/log/imanage.log")
		formatter = logging.Formatter("%(levelname)s %(asctime)s %(funcName)s %(lineno)d %(message)s")
		handler.setFormatter(formatter)
		self.log.addHandler(handler)
		self.log.info("\tStart")
		# Afficher un icon personnalisé
		try:
			if os.name =="posix":
				self.master.option_add("*Font", "Helvetica -12", "userDefault")
				img = PhotoImage(file=self.imanage_path+"/icons/Donald-icon.gif")
				self.master.tk.call("wm", "iconphoto", self.master._w, img)
			else:
				self.master.iconbitmap(default=self.imanage_path+"/icons/Donald-icon.gif")
		except TclError:
			self.log.warning("le window manager ne supporte pas l'icône que je veux lui mettre...")
		self.parent=parent
		Pmw.initialise(self.master)
		Pmw.reporterrorstofile(file = sys.stderr)
		self.pack(expand=YES, fill=BOTH)
		self.gifsdict={}
		self.initialize()
		self.createWidgets()

	def initialize(self):
		# Create the Balloon.
		self.balloon = Pmw.Balloon(self.parent)
		self.reservationSchedule=None
		self.ocupancySchedule=None
		self.cleaningSchedule=None
		self.technicalSchedule=None
		self.enabledColor=u"white"
		self.disabledColor=u"gray70"
		self.fillDB()

	def fillDB(self):
		if os.path.exists(self.imanage_path+"/data/data.db"):
			self.log.info("\tdatabase check...OK")
		else:
			FullDB.fillTableDemo(self, log=self.log)

	def createWidgets(self):
		self.makeMenuBar()
		self.makeToolBar()

	def makeMenuBar(self):
		self.menubar = Menu(self.master)
		self.master.config(menu=self.menubar)
		self.fileMenu()
		self.dataMenu()
		self.helpMenu()

	def fileMenu(self):
		imgfilePreference=self.imanage_path+"/icons/Preference-icon.gif"
		self.gifsdict[imgfilePreference] = PhotoImage(file=imgfilePreference)
		imgfileBackup=self.imanage_path+"/icons/Backup-icon.gif"
		self.gifsdict[imgfileBackup] = PhotoImage(file=imgfileBackup)
		imgfileSync=self.imanage_path+"/icons/synchroniser-icon.gif"
		self.gifsdict[imgfileSync] = PhotoImage(file=imgfileSync)
		self.imgfileExit=self.imanage_path+"/icons/Exit-icon.gif"
		self.gifsdict[self.imgfileExit] = PhotoImage(file=self.imgfileExit)
		
		pulldown = Menu(self.menubar)
		pulldown.add_command(label=u"Préférences", image=self.gifsdict[imgfilePreference], compound='left', command=self.parameters)
		pulldown.add_command(label=u"Sauvegardes", image=self.gifsdict[imgfileBackup], compound='left', command=self.ctrlBackup)
		pulldown.add_command(label=u"Synchro Web", image=self.gifsdict[imgfileSync], compound='left', command=self.notdone)
		pulldown.add_command(label=u"Quitter", image=self.gifsdict[self.imgfileExit], compound='left', command=self.closeiManage)
		self.menubar.add_cascade(label=u"Options", underline=0, menu=pulldown)

	def dataMenu(self):
		imgfileArea=self.imanage_path+"/icons/Area-icon.gif"
		self.gifsdict[imgfileArea] = PhotoImage(file=imgfileArea)
		imgfilePerson=self.imanage_path+"/icons/Person-icon.gif"
		self.gifsdict[imgfilePerson] = PhotoImage(file=imgfilePerson)
		imgfileGeneralite=self.imanage_path+"/icons/Generalite-icon.gif"
		self.gifsdict[imgfileGeneralite] = PhotoImage(file=imgfileGeneralite)
		
		imgfileEmployer=self.imanage_path+"/icons/Employer-icon.gif"
		self.gifsdict[imgfileEmployer] = PhotoImage(file=imgfileEmployer)
		imgfileStaff=self.imanage_path+"/icons/Staff-icon.gif"
		self.gifsdict[imgfileStaff] = PhotoImage(file=imgfileStaff)
		imgfileTime=self.imanage_path+"/icons/Time-icon.gif"
		self.gifsdict[imgfileTime] = PhotoImage(file=imgfileTime)
		
		imgfilePlace=self.imanage_path+"/icons/Place-icon.gif"
		self.gifsdict[imgfilePlace] = PhotoImage(file=imgfilePlace)
		imgfileFamily=self.imanage_path+"/icons/Family-icon.gif"
		self.gifsdict[imgfileFamily] = PhotoImage(file=imgfileFamily)
		imgfileProduct=self.imanage_path+"/icons/Product-icon.gif"
		self.gifsdict[imgfileProduct] = PhotoImage(file=imgfileProduct)
		imgfileService=self.imanage_path+"/icons/Service-icon.gif"
		self.gifsdict[imgfileService] = PhotoImage(file=imgfileService)
		imgfileItem=self.imanage_path+"/icons/Item-icon.gif"
		self.gifsdict[imgfileItem] = PhotoImage(file=imgfileItem)
		imgfileParking=self.imanage_path+"/icons/Parking-icon.gif"
		self.gifsdict[imgfileParking] = PhotoImage(file=imgfileParking)
		imgfileStock=self.imanage_path+"/icons/Stock-icon.gif"
		self.gifsdict[imgfileStock] = PhotoImage(file=imgfileStock)
		imgfileInventory=self.imanage_path+"/icons/Inventory-icon.gif"
		self.gifsdict[imgfileInventory] = PhotoImage(file=imgfileInventory)
		imgfileAdministration=self.imanage_path+"/icons/Administration-icon.gif"
		self.gifsdict[imgfileAdministration] = PhotoImage(file=imgfileAdministration)
		
		self.imgfileReservation=self.imanage_path+"/icons/Reservation-icon.gif"
		self.gifsdict[self.imgfileReservation] = PhotoImage(file=self.imgfileReservation)
		self.imgfileOcupancy=self.imanage_path+"/icons/Ocupancy-icon.gif"
		self.gifsdict[self.imgfileOcupancy] = PhotoImage(file=self.imgfileOcupancy)
		self.imgfileCleaning=self.imanage_path+"/icons/Cleaning-icon.gif"
		self.gifsdict[self.imgfileCleaning] = PhotoImage(file=self.imgfileCleaning)
		self.imgfileTechnical=self.imanage_path+"/icons/Technical-icon.gif"
		self.gifsdict[self.imgfileTechnical] = PhotoImage(file=self.imgfileTechnical)
		imgfileAccueil=self.imanage_path+"/icons/Accueil-icon.gif"
		self.gifsdict[imgfileAccueil] = PhotoImage(file=imgfileAccueil)
		
		imgfileTax=self.imanage_path+"/icons/Tax-icon.gif"
		self.gifsdict[imgfileTax] = PhotoImage(file=imgfileTax)
		imgfileDiscount=self.imanage_path+"/icons/Discount-icon.gif"
		self.gifsdict[imgfileDiscount] = PhotoImage(file=imgfileDiscount)
		imgfileCatalogue=self.imanage_path+"/icons/Catalogue-icon.gif"
		self.gifsdict[imgfileCatalogue] = PhotoImage(file=imgfileCatalogue)
		imgfileBill=self.imanage_path+"/icons/Bill-icon.gif"
		self.gifsdict[imgfileBill] = PhotoImage(file=imgfileBill)
		imgfileComptabilite=self.imanage_path+"/icons/Comptabilite-icon.gif"
		self.gifsdict[imgfileComptabilite] = PhotoImage(file=imgfileComptabilite)
		
		pulldown = Menu(self.menubar)
		submenu1 = Menu(pulldown, tearoff=0)
		submenu1.add_command(label=u"Lieux", image=self.gifsdict[imgfileArea], compound='left', command=self.ctrlArea,accelerator="Ctrl+L")
		submenu1.add_command(label=u"Individus", image=self.gifsdict[imgfilePerson], compound='left', command=self.ctrlPerson, accelerator="Ctrl+I")
		pulldown.add_cascade(label=u"Généralités", image=self.gifsdict[imgfileGeneralite], compound='left', menu=submenu1)
		
		submenu2 = Menu(pulldown, tearoff=0)
		submenu2.add_command(label=u"Employés", image=self.gifsdict[imgfileStaff], compound='left',command=self.ctrlStaff, accelerator="Ctrl+E")
		submenu2.add_command(label=u"Feuilles d'heures", image=self.gifsdict[imgfileTime], compound='left',command=self.ctrlTimeSheetStaff, accelerator="Ctrl+H")
		pulldown.add_cascade(label=u"Le Personnel", image=self.gifsdict[imgfileEmployer], compound='left', menu=submenu2)
		
		submenu3 = Menu(pulldown, tearoff=0)
		submenu3.add_command(label=u"Résidences", image=self.gifsdict[imgfilePlace], compound='left',command=self.ctrlPlace, accelerator="Ctrl+K")
		submenu4 = Menu(pulldown, tearoff=0)
		submenu4.add_command(label=u"Familles de Produits", image=self.gifsdict[imgfileProduct], compound='left', command=self.ctrlProductFamily, accelerator="Ctrl+W")
		submenu4.add_command(label=u"Familles de Services", image=self.gifsdict[imgfileService], compound='left', command=self.ctrlServiceFamily, accelerator="Ctrl+Z")
		submenu4.add_command(label=u"Familles d'Articles", image=self.gifsdict[imgfileItem], compound='left', command=self.ctrlItemFamily, accelerator="Ctrl+A")
		submenu3.add_cascade(label=u"Familles", image=self.gifsdict[imgfileFamily], compound='left', menu=submenu4)
		submenu3.add_command(label=u"Produits", image=self.gifsdict[imgfileProduct], compound='left', command=self.ctrlProduct, accelerator="Ctrl+V")
		submenu3.add_command(label=u"Services", image=self.gifsdict[imgfileService], compound='left', command=self.ctrlService, accelerator="Ctrl+Y")
		submenu3.add_command(label=u"Articles", image=self.gifsdict[imgfileItem], compound='left', command=self.ctrlItem, accelerator="Ctrl+U")
		submenu3.add_command(label=u"Parkings", image=self.gifsdict[imgfileParking], compound='left', command=self.ctrlParking, accelerator="Ctrl+P")
		submenu3.add_command(label=u"Stocks", image=self.gifsdict[imgfileStock], compound='left', command=self.ctrlStock, accelerator="Ctrl+B")
		submenu3.add_command(label=u"Inventaires", image=self.gifsdict[imgfileInventory], compound='left', command=self.ctrlInvantory, accelerator="Ctrl+N")
		pulldown.add_cascade(label=u"Administration", image=self.gifsdict[imgfileAdministration], compound='left', menu=submenu3)
		
		submenu5 = Menu(pulldown, tearoff=0)
		submenu5.add_command(label=u"Réservations", image=self.gifsdict[self.imgfileReservation], compound='left', command=self.ctrlStay, accelerator="Ctrl+R")
		submenu5.add_command(label=u"Arrivées - Départs", image=self.gifsdict[self.imgfileOcupancy], compound='left', command=self.ctrlOcupancy ,accelerator="Ctrl+O")
		submenu5.add_command(label=u"Ménages", image=self.gifsdict[self.imgfileCleaning], compound='left', command=self.ctrlCleaning, accelerator="Ctrl+M")
		submenu5.add_command(label=u"Techniques", image=self.gifsdict[self.imgfileTechnical], compound='left', command=self.ctrlTechnical ,accelerator="Ctrl+T")
		pulldown.add_cascade(label=u"Accueil", image=self.gifsdict[imgfileAccueil], compound='left', menu=submenu5)
		
		submenu6 = Menu(pulldown, tearoff=0)
		submenu6.add_command(label=u"Taxes", image=self.gifsdict[imgfileTax], compound='left', command=self.ctrlTax, accelerator="Ctrl+J")
		submenu6.add_command(label=u"Remises", image=self.gifsdict[imgfileDiscount], compound='left', command=self.ctrlDiscount, accelerator="Ctrl+D")
		submenu6.add_command(label=u"Catalogues", image=self.gifsdict[imgfileCatalogue], compound='left', command=self.ctrlCatalogue, accelerator="Ctrl+G")
		submenu6.add_command(label=u"Pièces de ventes", image=self.gifsdict[imgfileBill], compound='left', command=self.ctrlBill, accelerator="Ctrl+F")
		pulldown.add_cascade(label=u"Comptabilité",   image=self.gifsdict[imgfileComptabilite], compound='left', menu=submenu6)
		
		self.menubar.add_cascade(label=u"Catégories", underline=0, menu=pulldown)

	def helpMenu(self):
		imgfileHelp=self.imanage_path+"/icons/Help-icon.gif"
		self.gifsdict[imgfileHelp] = PhotoImage(file=imgfileHelp)
		imgfileAbout=self.imanage_path+"/icons/Donald-icon.gif"
		self.gifsdict[imgfileAbout] = PhotoImage(file=imgfileAbout)
		
		pulldown = Menu(self.menubar)
		pulldown.add_command(label=u"Aide", image=self.gifsdict[imgfileHelp], compound='left', command=self.notdone)
		pulldown.add_command(label=u"A propos de", image=self.gifsdict[imgfileAbout], compound='left', command=self.about)
		self.menubar.add_cascade(label=u"?", underline=0, menu=pulldown)

	def makeToolBar(self):
		toolbar = Frame(self, cursor="hand2", relief=SUNKEN, bd=1)
		toolbar.pack(side=BOTTOM, fill=X)
		Button(toolbar, text=u"Quitter", image=self.gifsdict[self.imgfileExit], compound='left', command=self.closeiManage).pack(side=RIGHT)
		self.reserBt=Button(toolbar, background=self.disabledColor, text=u"Réservations", image=self.gifsdict[self.imgfileReservation], compound='left', command=self.ctrlReservationSchedule)
		self.reserBt.pack(side=LEFT)
		self.ocupBt=Button(toolbar, background=self.disabledColor, text=u"Occupation", image=self.gifsdict[self.imgfileOcupancy], compound='left', command=self.ctrlOcupancySchedule)
		self.ocupBt.pack(side=LEFT)
		self.cleanBt=Button(toolbar, background=self.disabledColor, text=u"Entretien", image=self.gifsdict[self.imgfileCleaning], compound='left', command=self.ctrlCleaningSchedule)
		self.cleanBt.pack(side=LEFT)
		self.techBt=Button(toolbar, background=self.disabledColor, text=u"Technique", image=self.gifsdict[self.imgfileTechnical], compound='left', command=self.ctrlTechnicalSchedule)
		self.techBt.pack(side=LEFT)

	def parameters(self):
		showinfo(u"Paramétres", u"Paramétrage et personalisation de iManager\nFonction non implementée\nMerci de votre patience")

	def about(self):
		showinfo(u"A propos", u"Bed and Breakfast\n\nversion 0.4\n\nLicence GNU (General Public License)\n\nCopyright (C) 2007-2011 Lugo Creation")

	def notdone(self):
		showerror(u"Message d'erreur...", u"Fonction non implementée\nMerci de votre patience")

	# GESTION DES MODULES
	def ctrlArea(self):
		AreaGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlPerson(self):
		PersonGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlPlace(self):
		PlaceGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlStaff(self):
		StaffGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlTimeSheetStaff(self):
		TimeSheetStaffGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlProductFamily(self):
		ProductFamilyGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlServiceFamily(self):
		ServiceFamilyGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlItemFamily(self):
		ItemFamilyGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlProduct(self):
		ProductGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlService(self):
		ServiceGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlItem(self):
		ItemGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlParking(self):
		ParkingGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlStay(self):
		StayGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlOcupancy(self):
		OcupancyGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlCleaning(self):
		CleaningGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlTechnical(self):
		TechnicalGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlCatalogue(self):
		CatalogueGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlDiscount(self):
		DiscountGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlTax(self):
		TaxGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlBill(self):
		BillGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlStock(self):
		StockGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlInvantory(self):
		InvantoryGUI(balloon=self.balloon, path=self.imanage_path, log=self.log)

	def ctrlBackup(self):
		BackupDB(path=self.imanage_path, log=self.log)

	def ctrlReservationSchedule(self):
		if self.reservationSchedule is None:
			self.reservationSchedule=ReservationGUI(balloon=self.balloon, path=self.imanage_path, mainFrame=self, log=self.log)
			if self.ocupancySchedule is not None:
				self.ocupancySchedule.close()
				self.ocupancySchedule=None
			if self.cleaningSchedule is not None:
				self.cleaningSchedule.close()
				self.cleaningSchedule=None
			if self.technicalSchedule is not None:
				self.technicalSchedule.close()
				self.technicalSchedule=None
			self.reserBt.config(background=self.enabledColor)
			self.ocupBt.config(background=self.disabledColor)
			self.cleanBt.config(background=self.disabledColor)
			self.techBt.config(background=self.disabledColor)
		else:
			self.reservationSchedule.close()
			self.reservationSchedule=None
			self.reserBt.config(background=self.disabledColor)

	def ctrlOcupancySchedule(self):
		if self.ocupancySchedule is None:
			self.ocupancySchedule=OcupancyScheduleGUI(balloon=self.balloon, path=self.imanage_path, mainFrame=self, log=self.log)
			if self.reservationSchedule is not None:
				self.reservationSchedule.close()
				self.reservationSchedule=None
			if self.cleaningSchedule is not None:
				self.cleaningSchedule.close()
				self.cleaningSchedule=None
			if self.technicalSchedule is not None:
				self.technicalSchedule.close()
				self.technicalSchedule=None
			self.reserBt.config(background=self.disabledColor)
			self.ocupBt.config(background=self.enabledColor)
			self.cleanBt.config(background=self.disabledColor)
			self.techBt.config(background=self.disabledColor)
		else:
			self.ocupancySchedule.close()
			self.ocupancySchedule=None
			self.ocupBt.config(background=self.disabledColor)

	def ctrlCleaningSchedule(self):
		if self.cleaningSchedule is None:
			self.cleaningSchedule=CleaningScheduleGUI(balloon=self.balloon, path=self.imanage_path, mainFrame=self, log=self.log)
			if self.ocupancySchedule is not None:
				self.ocupancySchedule.close()
				self.ocupancySchedule=None
			if self.reservationSchedule is not None:
				self.reservationSchedule.close()
				self.reservationSchedule=None
			if self.technicalSchedule is not None:
				self.technicalSchedule.close()
				self.technicalSchedule=None
			self.reserBt.config(background=self.disabledColor)
			self.ocupBt.config(background=self.disabledColor)
			self.cleanBt.config(background=self.enabledColor)
			self.techBt.config(background=self.disabledColor)
		else:
			self.cleaningSchedule.close()
			self.cleaningSchedule=None
			self.cleanBt.config(background=self.disabledColor)

	def ctrlTechnicalSchedule(self):
		if self.technicalSchedule is None:
			self.technicalSchedule=TechnicalScheduleGUI(balloon=self.balloon, path=self.imanage_path, mainFrame=self, log=self.log)
			if self.ocupancySchedule is not None:
				self.ocupancySchedule.close()
				self.ocupancySchedule=None
			if self.cleaningSchedule is not None:
				self.cleaningSchedule.close()
				self.cleaningSchedule=None
			if self.reservationSchedule is not None:
				self.reservationSchedule.close()
				self.reservationSchedule=None
			self.reserBt.config(background=self.disabledColor)
			self.ocupBt.config(background=self.disabledColor)
			self.cleanBt.config(background=self.disabledColor)
			self.techBt.config(background=self.enabledColor)
		else:
			self.technicalSchedule.close()
			self.technicalSchedule=None
			self.techBt.config(background=self.disabledColor)

	def closeiManage(self):
		if askyesno(u"Quitter", u"Etes vous certain de vouloir quitter\nBed and Breakfast ?"):
			self.log.info("\tStop")
			Frame.quit(self)

	# TODO 	Pour les Combobox travailler avec les index (int) plutôt que le contenu du champ.
	#      		voir la methode def selectReservationPlace
	#
	# TODO 	Re-travailler l'integration des dépendences dans le module Résidence.
	#      		Visibilité du nombres de produits, parking, staff (bill, stock) rattaché,
	#
	# TODO 	Détailer la visibilité sur les ménages et intervention technique
	#      		en cours dans le module OcupancySchedule prendre en compte les intervention
	#
	# TODO 	Module Bill  ajouter un résumé des totaux par taxes.
	#
	# TODO 	le verouillage et la cohérence des données
	#      		(exemple : bloqué les plages de reservation passée en ferme, empécher
	#      		le rattachement de services ou parking en dehors des cites
	#      		sur lesquells des produit on été choisi... etc....)
	#
	# TODO 	mettre en place le module d'impression PDF avec ReportLab
	#
	# TODO 	mettre en place un affichage de type tableau
	#      		(comme dans le module catalogue ou pieces de vente) chaque fois
	#      		que la clarté de l'affichage est necessaire
	#
	# TODO 	gerer le formatage de l'affichage a 2 decimales après la virgule (%2.f %)
	#
	# TODO 	dans TimeSheetStaff afficher la liste des tache de l'employé dès ca séléction
	#
	# TODO  developer un module de syncronisation des reservation avec un site web
	#				version comics (python) + version php
	#				inclure une page web d'affichage type des disponibilités

if __name__ == "__main__":
    iManageGUI().mainloop()